﻿
/*----------------------------------------------------------------//
// 文件名：MoContract.cs
// 文件功能描述：实体 MoContract.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoContract
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoContract
	/// </summary>
	public partial class MoContract:ICloneable
	{
		#region 表Contract的字段
		private string _report_id;
		private string _uid;
		private string _client_id;
		private string _corp_name;
		private string _consigner;
		private string _linkman;
		private string _tel;
		private string _phone;
		private string _fax;
		private string _addr;
		private string _postcode;
		private string _email;
		private decimal _charge;
		private int _report_status;
		private string _report_url;
		private decimal _total_price;
		private DateTime _create_time;
		private DateTime _update_time;
		#endregion
		
		#region 构造函数
		public MoContract()
		{
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    _create_time= DateTime.Now;
		    _update_time= DateTime.Now;
		}
		#endregion
		
		#region 拷贝构造函数

		public MoContract(MoContract item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoContract(string report_id,string uid,string client_id,string corp_name,string consigner,string linkman,string tel,string phone,string fax,string addr,string postcode,string email,decimal charge,int report_status,string report_url,decimal total_price,DateTime create_time,DateTime update_time)
		{
		this._report_id=report_id;
		this._uid=uid;
		this._client_id=client_id;
		this._corp_name=corp_name;
		this._consigner=consigner;
		this._linkman=linkman;
		this._tel=tel;
		this._phone=phone;
		this._fax=fax;
		this._addr=addr;
		this._postcode=postcode;
		this._email=email;
		this._charge=charge;
		this._report_status=report_status;
		this._report_url=report_url;
		this._total_price=total_price;
		this._create_time=create_time;
		this._update_time=update_time;
		}
		#endregion
		
		#region 表Contract的字段属性
		/// <summary>
		///编号规则为NO. LDYYMMXXX，其中NO.LD为固定前缀，YY表示年份，MM代表月份，XXX代表当月第几个报告。XXX为业务组手工录入。此编号不能重复。报告编号做为唯一值编号贯穿于整个系统流程（包括财务、业务、试验、报告等各部门）
		/// </summary>
		public string Report_Id
		{
			get {return _report_id;}
			set {_report_id=value;}
		}
		/// <summary>
		///用户ID默认等于人员编码。如：人员序号1，人员编码 E0001,姓名 张明   对应用户表 的用户ID就是E0001.
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		///客户ID应符合一定的规则。
		/// </summary>
		public string Client_Id
		{
			get {return _client_id;}
			set {_client_id=value;}
		}
		/// <summary>
		/// CORP_NAME
		/// </summary>
		public string Corp_Name
		{
			get {return _corp_name;}
			set {_corp_name=value;}
		}
		/// <summary>
		/// CONSIGNER
		/// </summary>
		public string Consigner
		{
			get {return _consigner;}
			set {_consigner=value;}
		}
		/// <summary>
		/// LINKMAN
		/// </summary>
		public string Linkman
		{
			get {return _linkman;}
			set {_linkman=value;}
		}
		/// <summary>
		/// TEL
		/// </summary>
		public string Tel
		{
			get {return _tel;}
			set {_tel=value;}
		}
		/// <summary>
		/// PHONE
		/// </summary>
		public string Phone
		{
			get {return _phone;}
			set {_phone=value;}
		}
		/// <summary>
		/// FAX
		/// </summary>
		public string Fax
		{
			get {return _fax;}
			set {_fax=value;}
		}
		/// <summary>
		/// ADDR
		/// </summary>
		public string Addr
		{
			get {return _addr;}
			set {_addr=value;}
		}
		/// <summary>
		/// POSTCODE
		/// </summary>
		public string Postcode
		{
			get {return _postcode;}
			set {_postcode=value;}
		}
		/// <summary>
		/// EMAIL
		/// </summary>
		public string Email
		{
			get {return _email;}
			set {_email=value;}
		}
		/// <summary>
		///实际缴纳的费用。一般这个值是小于PRICE（价格）的，因为有打折。
		/// </summary>
		public decimal Charge
		{
			get {return _charge;}
			set {_charge=value;}
		}
		/// <summary>
		///状态符合工作流标准。
		/// </summary>
		public int Report_Status
		{
			get {return _report_status;}
			set {_report_status=value;}
		}
		/// <summary>
		/// REPORT_URL
		/// </summary>
		public string Report_Url
		{
			get {return _report_url;}
			set {_report_url=value;}
		}
		/// <summary>
		/// TOTAL_PRICE
		/// </summary>
		public decimal Total_Price
		{
			get {return _total_price;}
			set {_total_price=value;}
		}
		/// <summary>
		/// CREATE_TIME
		/// </summary>
		public DateTime Create_Time
		{
			get {return _create_time;}
			set {_create_time=value;}
		}
		/// <summary>
		/// UPDATE_TIME
		/// </summary>
		public DateTime Update_Time
		{
			get {return _update_time;}
			set {_update_time=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoContract CopyTo(MoContract item)
        {
		    item.Report_Id=this.Report_Id;
		    item.Uid=this.Uid;
		    item.Client_Id=this.Client_Id;
		    item.Corp_Name=this.Corp_Name;
		    item.Consigner=this.Consigner;
		    item.Linkman=this.Linkman;
		    item.Tel=this.Tel;
		    item.Phone=this.Phone;
		    item.Fax=this.Fax;
		    item.Addr=this.Addr;
		    item.Postcode=this.Postcode;
		    item.Email=this.Email;
		    item.Charge=this.Charge;
		    item.Report_Status=this.Report_Status;
		    item.Report_Url=this.Report_Url;
		    item.Total_Price=this.Total_Price;
		    item.Create_Time=this.Create_Time;
		    item.Update_Time=this.Update_Time;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoContract NewContract=new MoContract();
		    NewContract._report_id=this._report_id;
		    NewContract._uid=this._uid;
		    NewContract._client_id=this._client_id;
		    NewContract._corp_name=this._corp_name;
		    NewContract._consigner=this._consigner;
		    NewContract._linkman=this._linkman;
		    NewContract._tel=this._tel;
		    NewContract._phone=this._phone;
		    NewContract._fax=this._fax;
		    NewContract._addr=this._addr;
		    NewContract._postcode=this._postcode;
		    NewContract._email=this._email;
		    NewContract._charge=this._charge;
		    NewContract._report_status=this._report_status;
		    NewContract._report_url=this._report_url;
		    NewContract._total_price=this._total_price;
		    NewContract._create_time=this._create_time;
		    NewContract._update_time=this._update_time;
			return NewContract;
		}
		
		private static MoContract _empty = new MoContract(string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,0,-1,string.Empty,0,DateTime.MinValue,DateTime.MinValue);
        public static MoContract Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoContract NewContract = obj as MoContract;
                if (NewContract == null)
                {
                    return false;
                }
                else
                {
				if (NewContract.Report_Id==this.Report_Id && NewContract.Uid==this.Uid && NewContract.Client_Id==this.Client_Id && NewContract.Corp_Name==this.Corp_Name && NewContract.Consigner==this.Consigner && NewContract.Linkman==this.Linkman && NewContract.Tel==this.Tel && NewContract.Phone==this.Phone && NewContract.Fax==this.Fax && NewContract.Addr==this.Addr && NewContract.Postcode==this.Postcode && NewContract.Email==this.Email && NewContract.Charge==this.Charge && NewContract.Report_Status==this.Report_Status && NewContract.Report_Url==this.Report_Url && NewContract.Total_Price==this.Total_Price && NewContract.Create_Time==this.Create_Time && NewContract.Update_Time==this.Update_Time)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Report_Id={0}/Uid={1}/Client_Id={2}/Corp_Name={3}/Consigner={4}/Linkman={5}/Tel={6}/Phone={7}/Fax={8}/Addr={9}/Postcode={10}/Email={11}/Charge={12}/Report_Status={13}/Report_Url={14}/Total_Price={15}/Create_Time={16}/Update_Time={17}",_report_id,_uid,_client_id,_corp_name,_consigner,_linkman,_tel,_phone,_fax,_addr,_postcode,_email,_charge,_report_status,_report_url,_total_price,_create_time,_update_time);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Report_ID"]!=null && row["Report_ID"]!=DBNull.Value)
			{
			    this.Report_Id = (string)row["Report_ID"];
			}
			else
			{
				this.Report_Id =string.Empty;
			}
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Client_ID"]!=null && row["Client_ID"]!=DBNull.Value)
			{
			    this.Client_Id = (string)row["Client_ID"];
			}
			else
			{
				this.Client_Id =string.Empty;
			}
		    if(row["Corp_Name"]!=null && row["Corp_Name"]!=DBNull.Value)
			{
			    this.Corp_Name = (string)row["Corp_Name"];
			}
			else
			{
				this.Corp_Name =string.Empty;
			}
		    if(row["Consigner"]!=null && row["Consigner"]!=DBNull.Value)
			{
			    this.Consigner = (string)row["Consigner"];
			}
			else
			{
				this.Consigner =string.Empty;
			}
		    if(row["Linkman"]!=null && row["Linkman"]!=DBNull.Value)
			{
			    this.Linkman = (string)row["Linkman"];
			}
			else
			{
				this.Linkman =string.Empty;
			}
		    if(row["Tel"]!=null && row["Tel"]!=DBNull.Value)
			{
			    this.Tel = (string)row["Tel"];
			}
			else
			{
				this.Tel =string.Empty;
			}
		    if(row["Phone"]!=null && row["Phone"]!=DBNull.Value)
			{
			    this.Phone = (string)row["Phone"];
			}
			else
			{
				this.Phone =string.Empty;
			}
		    if(row["Fax"]!=null && row["Fax"]!=DBNull.Value)
			{
			    this.Fax = (string)row["Fax"];
			}
			else
			{
				this.Fax =string.Empty;
			}
		    if(row["Addr"]!=null && row["Addr"]!=DBNull.Value)
			{
			    this.Addr = (string)row["Addr"];
			}
			else
			{
				this.Addr =string.Empty;
			}
		    if(row["Postcode"]!=null && row["Postcode"]!=DBNull.Value)
			{
			    this.Postcode = (string)row["Postcode"];
			}
			else
			{
				this.Postcode =string.Empty;
			}
		    if(row["email"]!=null && row["email"]!=DBNull.Value)
			{
			    this.Email = (string)row["email"];
			}
			else
			{
				this.Email =string.Empty;
			}
		    if(row["Charge"]!=null && row["Charge"]!=DBNull.Value)
			{
			    this.Charge = (decimal)row["Charge"];
			}
			else
			{
				this.Charge =0;
			}
		    if(row["Report_Status"]!=null && row["Report_Status"]!=DBNull.Value)
			{
			    this.Report_Status = (int)row["Report_Status"];
			}
			else
			{
				this.Report_Status =-1;
			}
		    if(row["Report_URL"]!=null && row["Report_URL"]!=DBNull.Value)
			{
			    this.Report_Url = (string)row["Report_URL"];
			}
			else
			{
				this.Report_Url =string.Empty;
			}
		    if(row["Total_Price"]!=null && row["Total_Price"]!=DBNull.Value)
			{
			    this.Total_Price = (decimal)row["Total_Price"];
			}
			else
			{
				this.Total_Price =0;
			}
		    if(row["Create_Time"]!=null && row["Create_Time"]!=DBNull.Value)
			{
			    this.Create_Time = (DateTime)row["Create_Time"];
			}
			else
			{
				this.Create_Time =DateTime.MinValue;
			}
		    if(row["Update_Time"]!=null && row["Update_Time"]!=DBNull.Value)
			{
			    this.Update_Time = (DateTime)row["Update_Time"];
			}
			else
			{
				this.Update_Time =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Report_ID"] = this.Report_Id;
			row["UID"] = this.Uid;
			row["Client_ID"] = this.Client_Id;
			row["Corp_Name"] = this.Corp_Name;
			row["Consigner"] = this.Consigner;
			row["Linkman"] = this.Linkman;
			row["Tel"] = this.Tel;
			row["Phone"] = this.Phone;
			row["Fax"] = this.Fax;
			row["Addr"] = this.Addr;
			row["Postcode"] = this.Postcode;
			row["email"] = this.Email;
			row["Charge"] = this.Charge;
			row["Report_Status"] = this.Report_Status;
			row["Report_URL"] = this.Report_Url;
			row["Total_Price"] = this.Total_Price;
			row["Create_Time"] = this.Create_Time;
			row["Update_Time"] = this.Update_Time;
		}
		#endregion
	}
}
#endregion
